/*

Author   : chaos

FileName : enum_var.cpp

Date     : 10/08/17 15:55:00

*/
#include <iostream>
using namespace std;

enum FRUIT {
    START = 0,
    APPLE = 0,
    ORANGE,
    BANANA,
    PEAR,
    GRAPE,
    LAST
};

int main(int argc ,char *argv[])
{
    enum FRUIT fruit;

    char *fruit_name[]={"APPLE","ORANGE","BANANA","PEAR","GRAPE"};

    fruit = APPLE;

    for(fruit=START;fruit<=LAST;fruit=(enum FRUIT)(fruit+1))
        cout << fruit_name[fruit] << "=" << fruit << endl;


    return 0;
}
